调backlight关键
kernel/drivers/input/misc/Tmd27711.c 288 289
device/cct/common/libsku7sensors/LightSensor.cpp *136 140 159 131
base/core/res/res/values/config.xml 507
package/apps/setting/src/com/Android/settings/displaysettings.java ??
//package/apps/setting/src/com/Android/settings/BrightnessPreference.java 162
编内核
./buildT20WGRETAIL kernel
烧boot.2knand.bin
编全部
./buildT20WGRETAIL
烧system.2knand.bin
编单android模块
trunk下
source build/envsetup.sh
choosecombo 1(release),16(T20WG),3(eng)
进模块目录
如:device/cct/common/libsku7sensors
执行mm
烧 out/.../system/lib/hw/sensor...(see Makefile)
又如:package/apps/setting/src/com/Android/settings/
烧 out/target/product/T20WG/data/app/SettingsTests.apk
coffee\trunk\out\target\product\T20WG\system\app\Settings.apk
流程:
*********************************************
应用层调用
*********************************************
/android_tcgit/packages/apps/Settings/src/com/android/settings/BrightnessPreference.java setBrightness()
*********************************************
Framework层
*********************************************
android_tcgit/frameworks/base/services/java/com/android/server/PowerManagerService.java setBacklightBrightness()
android_tcgit/frameworks/base/services/java/com/android/server/HardwareService.java setLightBrightness_UNCHECKED()
第一个参数是light的ID,第二个参数就是我们设置的亮度值brightness, 第三个参数是背光的模式
*********************************************
JNI层
*********************************************
android_tcgit/frameworks/base/services/jni/com_android_server_HardwareService.cpp setLight_native()
ptr是通过init_native获得的。init_native又是通过hw_get_module来获得到的。devices->lights[light]是一个我们已经打开对象
*********************************************
HAL层
*********************************************
android_tcgit/hardware/telechips/tcc92xx/module/lights/light.c set_light_backlight
这个里面的调用实际上也是通过ioctl的方式调用另外一个设备驱动程序。 那么接下来我们就看fb0这个内核驱动吧
*********************************************
Kernel层
*********************************************
/android_tcgit/kernel/drivers/video/tcc92xxfb.c(可以通过查询TCC_LCD_BL_SET来找到这个文件)